import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
import axios from 'axios'
import VueAxios from 'vue-axios'
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css'
import hljs from 'highlight.js'
import 'highlight.js/styles/monokai-sublime.css'
import VueHighlightJS from 'vue-highlightjs'
import G2 from '@antv/g2';
import Viser from 'viser-vue'
import BaiduMap from 'vue-baidu-map'
import md5 from 'js-md5';
import ECharts from 'vue-echarts'
import 'echarts/lib/chart/bar'
import 'echarts/lib/component/tooltip'
import 'echarts-gl'
import dataV from '@jiaminghi/data-view'
import Storage from 'vue-ls';
import vcolorpicker from 'vcolorpicker'
//复制到粘贴板插件
import VueClipboard from 'vue-clipboard2'


Vue.use(dataV)
Vue.component('v-chart', ECharts)

Vue.use(vcolorpicker)
const options = {
  namespace: 'vuejs__', // key prefix
  name: 'ls', // name variable Vue.[ls] or this.[$ls],
  storage: 'local', // storage name session, local, memory
};

Vue.use(VueClipboard);
Vue.use(Viser);
Vue.config.productionTip = false;
Vue.use(VueAxios, axios);
Vue.use(Antd);
Vue.use(G2);
Vue.use(VueHighlightJS);

Vue.use(BaiduMap, {
  ak: '4WAx6KUUrlqct7e5HFLjVZ4oADO1OtFx'
})
Vue.prototype.$md5 = md5;
Vue.use(Storage, options);
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

// 定义自定义指令 highlight 代码高亮
Vue.directive('highlight',function (el) {
  let blocks = el.querySelectorAll('pre code');
  blocks.forEach((block)=>{
    hljs.highlightBlock(block)
  })
});
